<%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2024/3/9
  Time: 16:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>访问次数</title>
</head>
<body>
<h1>当前页面访问次数为:<%=session.getAttribute("count")%></h1>
<!--
    通过URL重写的方式使用session时,其jsessionid不再通过cookie保存,而是通过请求保存
-->
<a href="<%=response.encodeURL(request.getContextPath()+"/count")%>">URL重写方式一</a><br>
<a href="<%=response.encodeRedirectURL(request.getContextPath()+"/count")%>">URL重写方式二</a>
</body>
</html>
